package com.pig4cloud.pig.common.swagger.annotation;

import com.pig4cloud.pig.common.swagger.config.SwaggerAutoConfiguration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Profile;
import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;

/**
 * 构造api接口文档
 * @author lw
 * @date 2020/4/21
 * 开启pigx swagger
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Import({SwaggerAutoConfiguration.class})
@Profile({"dev","test"})
public @interface EnableSwagger2Pro {

    /**
     * 需要引入的配置
     * @return
     */
    @AliasFor(value = "value",annotation = Import.class)
    Class<?>[] value() default {};

    /**
     * 注解生效环境（只在此环境生效）
     * @return
     */
    @AliasFor(value="value",annotation = Profile.class )
    String[] profile() default {"dev","test"};

}
